home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / wind5x.arc / W5X-VAR.INC < prev    next >
Text File  |  1991-01-09  |  9KB  |  180 lines

  1. { =========================================================================== }
  2. { W5X-var.inc - Variables for Multi-level windows          ver 5.X, 12-20-88 }
  3. {                                                                             }
  4. { This file contains all the variables needed for WNDW5X.TPU.  This lets you  }
  5. { know the variables being used, but it cannot be recompiled with WNDW5X.PAS  }
  6. { unless you have the complete source code.                                   }
  7. {   Copyright (C) 1987,1988 by James H. LeMay,  All rights reserved.          }
  8. { =========================================================================== }
  9.  
  10. const
  11.   { Change these to suit your data needs.  Source code required. }
  12.   MaxWndw        =  5;  { 1 - 254 : windows per video page }
  13.   MaxVirtualWndw =  2;  { 0 - 254 : total number of virtual windows - 1 }
  14.   MaxPageUsed    =  1;  { 0 - MaxPage : top video page number (usually 0) }
  15.                         { This can be greater than an expected MaxPage }
  16.  
  17. type
  18.   { Place all of your window names needed for random-access here: }
  19.   WindowNames = (
  20.     Window0,       { Reserved for the non-window area. }
  21.     Window1,  Window2,  Window3,  Window4,  Window5,
  22.     aWindow,       { A name for non-unique windows. }
  23.     FreeWindow);   { Reserved for a freed virtual windows stat. }
  24.   Borders = (
  25.     NoBrdr, BlankBrdr, SingleBrdr, DoubleBrdr, HdoubleBrdr,
  26.     VdoubleBrdr, SolidBrdr, EvenSolidBrdr, ThinSolidBrdr1,
  27.     ThinSolidBrdr2, LhatchBrdr, MhatchBrdr, HhatchBrdr,
  28.     UserBrdr1, UserBrdr2);
  29.   BrdrParts = (
  30.     BrdrTL,BrdrTH,BrdrTR,BrdrLV,BrdrRV,
  31.     BrdrBL,BrdrBH,BrdrBR,BrdrLT,BrdrHL,
  32.     BrdrRT,BrdrTT,BrdrVL,BrdrBT,BrdrCL);
  33.   BrdrRec =
  34.     record
  35.       case byte of
  36.         1: (TL,TH,TR,LV,RV,BL,BH,BR,LT,HL,RT,TT,VL,BT,CL: char);
  37.         2: (BrdrArray: array[BrdrTL..BrdrCL] of char);
  38.       end;
  39.         { The first letter of the border acronym mean:
  40.             T = top or tee  B = bottom
  41.             V = vertical    H = horiz
  42.             L = left        R = right
  43.             P = partition   C = cross
  44.           The second letter is the same except for:
  45.             T = tee         L = line
  46.           Here they are in their relative positions:
  47.             TL  TH  TT  TH  TR
  48.             LV      VL      RV
  49.             LT  HL  CL  HL  RT
  50.             LV      VL      RV
  51.             BL  BH  BT  BH  BR    }
  52.  
  53.   DirType = (NoDir,Up,Down,VeryTop,Top,Bottom,VeryBottom,FarLeft,Left,Right,
  54.              FarRight,Center,Horiz,Vertical);
  55.   WordArray        = array[0..32000] of word;  { Virtual array }
  56.   WordArrayPtrType = ^WordArray;
  57.   WndwStatType =
  58.     record
  59.       WSrow,WScol,WSrows,WScols,WSrow2,WScol2: byte; { Window w/ border }
  60.       Wrow ,Wcol ,Wrows ,Wcols ,Wrow2 ,Wcol2:  byte; { Window only }
  61.       WndwAttr,BrdrAttr,
  62.       OrigAttr:            integer;     { Original window attribute. }
  63.       WSbrdr,WSline:       Borders;
  64.       WSname:              WindowNames;
  65.       WSwhereR,WSwhereC:   byte;             { window-relative }
  66.       WSmodes:             word;
  67.       WScursor:            word;             { cursor mode for the window }
  68.       ULcol,ULcols,ULrows: byte;             { peculiar Underlay location }
  69.       ULbytes:             word;             { size in bytes for underlay }
  70.       ULptr:               WordArrayPtrType; { For Underlay }
  71.       VScrRec:             VScrRecType;      { Screen stats for Qwik }
  72.       RefRow,RefCol:       byte;             { Viewed corner in virtual wndw
  73.                                                or original WSrow & WScol for
  74.                                                hidden window }
  75.       ViewBrdr:            Borders;          { Border viewed on the CRT }
  76.       VI:                  word;             { Virtual level index }
  77.     end;
  78.   WndwStatsType    = array[0..MaxWndw]        of WndwStatType;
  79.   {$IfDef AddVirtual }
  80.   VirtualStatsType = array[0..MaxVirtualWndw] of WndwStatType;
  81.   {$EndIf }
  82.   MarginRec =
  83.     record   { Margins for limiting movement with MoveWindow or VResizeWindow }
  84.       LeftMargin, RightMargin, TopMargin, BottomMargin: byte;
  85.     end;
  86.  
  87. const
  88.   Brdr: array [BlankBrdr..UserBrdr2] of BrdrRec =
  89.     {   TL,TH,TR,LV,RV,BL,BH,BR,LT,HL,RT,TT,VL,BT,CL  }
  90.     ((BrdrArray:'               '),  { BlankBrdr      }
  91.      (BrdrArray:'┌─┐││└─┘├─┤┬│┴┼'),  { SingleBrdr     }
  92.      (BrdrArray:'╔═╗║║╚═╝╠═╣╦║╩╬'),  { DoubleBrdr     }
  93.      (BrdrArray:'╒═╕││╘═╛╞═╡╤│╧╪'),  { HdoubleBrdr    }
  94.      (BrdrArray:'╓─╖║║╙─╜╟─╢╥║╨╫'),  { VdoubleBrdr    }
  95.      (BrdrArray:'█████████─██│█┼'),  { SolidBrdr      }
  96.      (BrdrArray:'█▀████▄██─█▀│▄┼'),  { EvenSolidBrdr  }
  97.      (BrdrArray:'▐▀▌▐▌▐▄▌▐─▌▀│▄┼'),  { ThinSolidBrdr1 }
  98.      (BrdrArray:'▄▄▄▌▐▀▀▀▌─▐▄│▀┼'),  { ThinSolidBrdr2 }
  99.      (BrdrArray:'░░░░░░░░░─░░│░┼'),  { LhatchBrdr     }
  100.      (BrdrArray:'▒▒▒▒▒▒▒▒▒─▒▒│▒┼'),  { MhatchBrdr     }
  101.      (BrdrArray:'▓▓▓▓▓▓▓▓▓─▓▓│▓┼'),  { HhatchBrdr     }
  102.      (BrdrArray:'···············'),  { UserBrdr1      }  { Make your own }
  103.      (BrdrArray:'∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙')); { UserBrdr2      }  { Make your own }
  104.  
  105.     { Valid modes for SetWindowModes: }
  106.   RelMode       = $0001; { 00000001b - Window relative; temporary stats }
  107.   PermMode      = $0002; { 00000010b - Can't be moved or removed, no underlay }
  108.   ShadowLeft    = $0004; { 00000100b - Shadow on the left side }
  109.   ShadowRight   = $0008; { 00001000b - Shadow on the right side }
  110.   ZoomMode      = $0010; { 00010000b - Zoom effect on Make and AccessWindow }
  111.   HiddenMode    = $0020; { 00100000b - Create window while Hidden }
  112.   VirtualMode   = $0040; { 01000000b - Create Virtual window as well }
  113.   CursorOffMode = $0080; { 10000000b - Leave cursor off at all times }
  114.   SeeThruMode   = $0100; { 00000001b - Doesn't clear screen inside window }
  115.   NoHideMode    = $0200; { 00000010b - Ignores request to hide window }
  116.   NoAccessMode  = $0400; { 00000100b - Ignores request to access window }
  117.   NoMoveMode    = $0800; { 00001000b - Ignores request to move/resize window }
  118.     { Other modes for program detection: }
  119.   ToCRTmode     = $1000; { 00010000b - Writing to CRT }
  120.   ToHiddenMode  = $2000; { 00100000b - Writing to Hidden window }
  121.   ToVirtualMode = $4000; { 01000000b - Writing to Virtual window }
  122.  
  123.   ShadowColor: integer = Black;
  124.   ShadowChar:  char    = ' ';
  125.   TitleOfs:    byte    = 1;     { # of cols title placed offset from border }
  126.  
  127. var
  128.     { Boolean values corresponding to the above modes.  Automatically
  129.       set for the window you are in. }
  130.   RelFlag, PermFlag, ZoomFlag, HiddenFlag, VirtualFlag, CursorOffFlag,
  131.   SeeThruFlag, NoHideFlag, NoAccessFlag, NoMoveFlag,
  132.   ToCRTFlag, ToHiddenFlag, ToVirtualFlag: boolean;
  133.  
  134.   { -- Keep the following 10 variables in order for PageStatRec! -- }
  135.   WndwStat:       WndwStatsType;
  136.   TopWndwStat:    WndwStatType;  { Window stats on the top Level Index }
  137.   TWS:            WndwStatType absolute TopWndwStat;      { one in the same }
  138.     {$IfDef AddVirtual }
  139.   TopVirtualStat: WndwStatType;  { Optional virtual stats for top window. }
  140.   TVS:            WndwStatType absolute TopVirtualStat;   { one in the same }
  141.     {$EndIf }
  142.   LI,                         { Top Level Index }
  143.   HLI,                        { Hidden Level Index }
  144.   WI:             word;       { Window Index to save top stat (HLI or LI) }
  145.   PLI:            byte;       { Permanent window Level Index }
  146.   CursorDefault,              { Default cursor mode for each window }
  147.   WindowModes:    word;       { Logical sum of all window modes listed above }
  148.   Margins:        MarginRec;  { Limits for moving or resizing windows }
  149.  
  150. type
  151.   PageStatRec =
  152.     record
  153.       PageWS:     WndwStatsType;        { Equivalent to WndwStat }
  154.       PageTWS:    WndwStatType;         { Equivalent to TopWndwStat }
  155.         {$IfDef AddVirtual }
  156.       PageTVS:    WndwStatType;         { Equivalent to TopVirtualStat }
  157.         {$EndIf }
  158.       PageLI,PageHLI,PageWI: word;      { Equivalent to LI, HLI, and WI }
  159.       PagePLI:               byte;      { Equivalent to PLI }
  160.       PageCursor,
  161.       PageModes:             word;      { Equivalent to WindowModes. }
  162.       PageMargins:           MarginRec; { Equivalent to Margins. }
  163.     end;
  164.   PageStatRecs = array[0..MaxPageUsed] of PageStatRec;
  165.  
  166. var
  167.     {$IfDef MultiPage }
  168.   PageStat:       ^PageStatRecs;
  169.   TopPageStat:    PageStatRec absolute WndwStat;
  170.     {$EndIf }
  171.     {$IfDef AddVirtual }
  172.   VirtualStat:    ^VirtualStatsType;
  173.   VirtualRows,               { Default rows for virtual screen. }
  174.   VirtualCols:    byte;      { Default cols for virtual screen. }
  175.   VirtualSize:    word;      { VirtualCols * (VirtualRow+2) * 2 }
  176.     {$EndIf }
  177.   MaxValidPage:   byte;      { The lesser of MaxPage or MaxPageUsed }
  178.   ZoomDelay:      byte;      { Delay in ms between each Qbox for zoom effect }
  179.   AddrGoof:       pointer;   { Contains Far address of Goof }
  180.